package com.wyb.controller;

import com.wyb.mapper.ArticleMapper;
import com.wyb.constant.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/deletemyarticle")
public class DeleteMyArticleController {


    @Autowired
    private ArticleMapper articleMapper;

    @GetMapping
    public Result deleteArticle(int id){

        return articleMapper.deleteById(id) !=0 ? new Result(200, "成功删除文章", null)
                                                : new Result(201, "删除文章失败", null);
    }
}
